package com.sanerzone.smscenter.modules.sms.service;

import com.google.common.collect.Maps;
import com.sanerzone.jeebase.common.persistence.Page;
import com.sanerzone.jeebase.common.service.CrudService;
import com.sanerzone.smscenter.biz.config.SmsConfigInterfaceImpl;
import com.sanerzone.smscenter.biz.entity.TemplateRoute;
import com.sanerzone.smscenter.biz.iface.SmsConfigInterface;
import com.sanerzone.smscenter.modules.sms.dao.SmsTemplateRouteDao;
import com.sanerzone.smscenter.modules.sms.entity.SmsTemplateRoute;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * 网关模板管理Service
 * @author jianr.z
 * @version 2018-04-17
 */
@Service
@Transactional(readOnly = true)
public class SmsTemplateRouteService extends CrudService<SmsTemplateRouteDao,SmsTemplateRoute>{

//    @Autowired
    private SmsConfigInterface smsConfigInterfaceImpl = new SmsConfigInterfaceImpl();

    public SmsTemplateRoute get(String id) {
        return super.get(id);
    }

    public List<SmsTemplateRoute> findList(SmsTemplateRoute smsTemplateRoute) {
        return super.findList(smsTemplateRoute);
    }

    public Page<SmsTemplateRoute> findPage(Page<SmsTemplateRoute> page, SmsTemplateRoute smsTemplateRoute) {
        return super.findPage(page, smsTemplateRoute);
    }

    @Transactional(readOnly = false)
    public void save(SmsTemplateRoute smsTemplateRoute) {
        super.save(smsTemplateRoute);
    }

    @Transactional(readOnly = false)
    public void delete(SmsTemplateRoute smsTemplateRoute) {
        super.delete(smsTemplateRoute);
    }
    public List<TemplateRoute> findBizByGatewayGroupId(String groupId) {
        Map<String,String> map = Maps.newHashMap();
        map.put("groupId", groupId);
        return dao.findBizByGatewayGroupId(map);
    }

}
